<template>
    <div id="page">
        <p>
            <span>全局Bus属性跟着修改为：{{msg}}</span> 
            <br/>           
            <button @click=globalFunc>修改全局Bus属性</button>
        </p>
    </div>
</template>

<script>
    import Vue from 'vue'

    export default {
        name: "pagePlugin",
        data() {
            return {
            }
        },
        computed:{
            msg :  function(){
                return this.$Bus.num
                //return this.$EventBus.busData
                //return this.$root.$children[0].num
                //return this.__proto__.$arr.num
            }
        },
        methods:{
            globalFunc(){        
                this.$Bus.$emit('add',120)
            },
        },        
    }
</script>

<style scoped>
    button{
    border: none;
    background-color: #83d3f9;
    margin: 10px;
    color: #fff;
    height: 34px;
    padding: 0 10px;
    border-radius: 5px;
    border-bottom: 1px solid #ccc;
    border-right: 1px solid #ccc;
    }
</style>
